package cn.schoolwow.util.module.query.instanceList.handler;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.quickflow.listener.SingleFlowListener;

import java.util.List;

public class FilterInstanceListSingleFlowListener implements SingleFlowListener {
    @Override
    public void beforeExecuteFlow(BusinessFlow flow, FlowContext flowContext) throws Exception {
        List filterInstanceList = flowContext.getData("filterInstanceList",List.class);

        if(null==filterInstanceList||filterInstanceList.isEmpty()){
            flowContext.brokenCurrentFlow("过滤列表已经为空");
        }
    }

    @Override
    public void afterExecuteFlow(BusinessFlow flow, FlowContext flowContext) throws Exception {

    }

    @Override
    public String name() {
        return "判断过滤后的实例列表是否已经为空";
    }
}
